<?php
use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
use yii\helpers\Url;
?>
<style>
    .itemList .item-name{width: 70px;}
    input[type="text"]{padding-left: 10px;}
    input[type="reset"] {background-color:#999;}
</style>

<?php $form = ActiveForm::begin(['id'=>'myform']);?>
    <ul class="add_user">
        <li class="itemList clearfix">
            <label class="item-name">账户名称</label>
            <div class="item-txt">
                <?= Html::activeTextInput($model, 'login_name',['placeholder' => '输入账户名', 'data-rule' => 'length[~11]']) ?>
                <span class="red">*</span>
            </div>
        </li>
        <li class="itemList clearfix">
            <label class="item-name">账户密码</label>
            <div class="item-txt">
                <?php
                    if ($model->password) {
                        $model->password = '';
                ?>
                <?= Html::activeTextInput($model, 'password',['placeholder' => '输入密码','data-rule' => 'length[6~20]']) ?>
                <?php } else { ?>
                    <?= Html::activeTextInput($model, 'password',['placeholder' => '输入密码','data-rule' => 'required;length[6~20]']) ?>
                    <span class="red">*</span>
                <?php } ?>
            </div>
        </li>
        <li class="itemList clearfix">
            <label class="item-name">代理商名称</label>
            <div class="item-txt">
                <?= Html::activeTextInput($model, 'user_name', ['data-rule' => 'required;length[~20]']) ?>
                <span class="red">*</span>
            </div>
        </li>

        <li class="itemList clearfix">
            <label class="item-name">负责人</label>
            <div class="item-txt">
                <?= Html::activeTextInput($SysAgent, 'director', ['data-rule' => 'required;length[~20]']) ?>
                <span class="red">*</span>
            </div>
        </li>

        <li class="itemList clearfix">
            <label class="item-name">授权点数</label>
            <div class="item-txt">
                <?= Html::activeTextInput($SysAgent, 'point', ['data-rule' => 'integer[+]']) ?>
                <span class="red">*</span>
            </div>
        </li>

        <li class="itemList clearfix">
            <label class="item-name">联系电话</label>
            <div class="item-txt">
                <?= Html::activeTextInput($model, 'mobile',['data-rule' => 'mobile']) ?>
                <span class="red">*</span>
            </div>
        </li>

        <li class="itemList clearfix">
            <label class="item-name">通讯地址</label>
            <div class="item-txt">
                <?= Html::activeTextInput($model, 'address', ['data-rule' => 'required;length[~30]']) ?>
                <span class="red">*</span>
            </div>
        </li>

    </ul>
    <div style="padding-left: 80px;">
        <input type="submit" value="保存" class="sub btnBg" style="vertical-align: bottom;"/>
        <a class="btnBg" href="javascript:history.go(-1)">取消</a>
    </div>

<?php ActiveForm::end();?>